<?php
$view = new View('/head');
$view->space = 'user';
$view->title = text::get('application.page-title');
$view->render(true);
?>

<body>

<?php
$menuView = new View('/user/userMenu');
$menuView->render(true);

echo '<div id="contentBlock">';

html::printPath(
    array('registrationWizard.form-title' => 'user/registrationWizard/step', 'registrationWizard.' . $this->data->step . '-header' => ''),
    'registrationWizard.' . $this->data->step . '-desc'
);
$msg->printMessages();

$stepIndicator = new View('/user/registrationWizard/stepIndicator');
$stepIndicator->render(TRUE);

$mainSubview->render(true);
echo '</div>';

echo '<div id="wizardButtonsBlock">';
if ($this->wizardButtonsForm) {
    $this->wizardButtonsForm->write();
}
else {
        $fb = new FormBuilder(null, null);
        $wizardButtons = $fb->wizardButtons('/user/registrationWizard');

        if ($this->data->step == RegistrationWizardData::$STEPS[0]) {
            // First step
            $wizardButtons->restartEnabled(FALSE)->previousEnabled(FALSE);
        }

        if ($this->data->step == RegistrationWizardData::$STEPS[count(RegistrationWizardData::$STEPS) - 1]) {
            // Last step
            $fb->setAction('/user/registrationWizard/finish');
            $wizardButtons->nextEnabled(FALSE)->finishEnabled(TRUE);
        }
        else {
            $fb->setAction('/user/registrationWizard/next');
        }
        $fb->write();
}
echo '</div>';

$footer = new View('/footer');
$footer->render(true);
?>

</body>
</html>
